package com.niiwoo.civet.trade.dto.response.invest;

import java.io.Serializable;
import java.util.List;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class DayPackageInfoDTO implements Serializable, Comparable<DayPackageInfoDTO> {
	private static final long serialVersionUID = 8103211609170456019L;
	
	// 智能投title
	private String packageTitile;
	// 智能投订单ID
	private String packageOrderId;
	// 状态，1-代还；2-已回款
	private Byte status;
	// 智能投下相关投资回款信息
	private List<DayInvestorPlanInfoDTO> investorPlans;
	
	@Override
	public int compareTo(DayPackageInfoDTO obj) {
		byte statusDiff = (byte) (this.getStatus() - obj.getStatus());
		
		if (statusDiff == 0) {
			return (Long.valueOf(this.getPackageOrderId()) - Long.valueOf(obj.getPackageOrderId())) > 0 ? 1 : -1;
		}
		
		return statusDiff;
	}
}
